#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/4/12 9:57
# @Author  : ldh

from basic.UIParent import UIParent
from commen.page.ann.oclifePage import oclifePage
from time import sleep
from basic.utils.asserts import asserts
from test.help.pocesuiteDome import Steps

class OclifeCase(UIParent):

    @classmethod
    def test_openOclife(self):
        '''打开一码通城、关闭引导蒙层'''

        #判断是否已登录
        Steps.do_login()
        oclifePage.clickOclife()
        oclifePage.closeGuide()

    #一码通城页面校验
        sleep(3)
        status=oclifePage.ifOclife()
        asserts.equal(status,True,"一码通城页面校验")


    @classmethod
    def test_payChannel(self):
        '''一码通城-支付方式校验'''

        #判断是否已登录
        Steps.do_login()
        oclifePage.clickOclife()
        oclifePage.closeGuide()

        oclifePage.clickPayChannel()
        sleep(5)
        chanellList=oclifePage.getPayChannel()
        asserts.true(len(chanellList)>0,"免密方式返回校验")


    @classmethod
    def test_moreScene(self):
        '''一码通城-更多场景校验'''

        # 判断是否已登录
        Steps.do_login()
        oclifePage.clickOclife()
        oclifePage.closeGuide()

        oclifePage.clickMoreScene()
        sleep(3)
        chanellList=oclifePage.getChannelFunction()
        asserts.true(len(chanellList)>0,"更多场景列表校验")


    @classmethod
    def test_bills(self):
        '''一码通城-账单校验'''

        # 判断是否已登录
        Steps.do_login()
        oclifePage.clickOclife()
        oclifePage.closeGuide()

        oclifePage.clickBills()
        sleep(3)
        status=oclifePage.EmptyBill
        if status==True:
            print("账单记录为空！")
        else:
            billList=oclifePage.billList()
            asserts.true(len(billList)>0,"账单列表")










